Skip to content

[ROCm][Refactor] Enable GPTQMarlinConfig on ROCm to use choose_mp_linear_kernel - #885

Merged
mgehre-amd merged 1 commit into
gfx11from
matthias.gptq_via_mp_linear
Apr 20, 2026
Merged

mgehre-amd merged 1 commit into
gfx11from
matthias.gptq_via_mp_linear

Conversation

@mgehre-amd

@mgehre-amd mgehre-amd commented Apr 17, 2026 •

Copy link
Copy Markdown

On ROCm, GPTQ models were forced through the legacy GPTQConfig → GPTQLinearMethod → ops.gptq_gemm path, bypassing the choose_mp_linear_kernel framework entirely. This meant any new kernel added to the MPLinearKernel registry like our Hybrid int4 GEMM would never be used for GPTQ models on ROCm.

This change allows GPTQMarlinConfig to be selected on ROCm by using is_cuda_alike() instead of is_cuda() in the compatibility check, and skips the NVIDIA device_capability gate in query_marlin_supported_quant_types on ROCm (since ROCm device capabilities do not map to NVIDIA compute capability semantics).

Using the new kernel improves perf and unifies GPTQ models to use the same kernels as AWQ models

…ear_kernel

On ROCm, GPTQ models were forced through the legacy GPTQConfig →
GPTQLinearMethod → ops.gptq_gemm path, bypassing the
choose_mp_linear_kernel framework entirely. This meant any new kernel
added to the MPLinearKernel registry (Conch, future kernels) would
never be used for GPTQ models on ROCm.

This change allows GPTQMarlinConfig to be selected on ROCm by using
is_cuda_alike() instead of is_cuda() in the compatibility check, and
skips the NVIDIA device_capability gate in query_marlin_supported_quant_types
on ROCm (since ROCm device capabilities do not map to NVIDIA compute
capability semantics).

Also fixes ConchLinearKernel to handle symmetric quantization (no zero
points) by clearing the raw packed qzeros attribute on the layer, so
_get_weight_params returns None for w_zp. Without this fix, the
unprocessed packed qzeros tensor was passed to the Conch Triton kernel,
causing an illegal memory access.

Before this change, GPTQ on ROCm used ops.gptq_gemm (ExLlama v2)
directly. After this change, choose_mp_linear_kernel selects
ConchLinearKernel by default. ExllamaLinearKernel (same ops.gptq_gemm
kernel as before) can be used via
VLLM_DISABLED_KERNELS=ConchLinearKernel.

Benchmarked on AMD Strix Halo (gfx1151, LPDDR5X-8000 128 GB):

Model: TheBloke/Llama-2-7B-Chat-GPTQ
input-len=128, output-len=128, num-prompts=5:
  ConchLinearKernel (default):
    Median TTFT: 112 ms
    Median TPOT: 90.50 ms
  ExllamaLinearKernel:
    Median TTFT: 168 ms
    Median TPOT: 19.24 ms

Accuracy (lm_eval gsm8k, 200 samples, ExllamaLinearKernel):
  TheBloke/Llama-2-7B-Chat-GPTQ: 0.135 → 0.140 (no regression)

Signed-off-by: Matthias Gehre <matthias.gehre@amd.com>
@mgehre-amd
mgehre-amd requested a review from marcusr-amd April 17, 2026 17:06
@mgehre-amd
mgehre-amd marked this pull request as ready for review April 17, 2026 17:06
@mgehre-amd
mgehre-amd merged commit 6e9daea into gfx11 Apr 20, 2026
8 checks passed
@mgehre-amd
mgehre-amd deleted the matthias.gptq_via_mp_linear branch April 20, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants